
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            {include file="template/form_header" /}
            <form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
                <div class="box-body">
                    <div class="fields-group">
                        {if isset($info)}
                        <input id="id" name="id" value="{$info.id}" hidden placeholder="请勿修改">
                        {/if}
                        <div class="form-group">
                            <label class="col-sm-2 control-label">角色</label>
                            <div class="col-sm-8">
                                <div class="input-group iconpicker-container">
                                    {foreach name='roles' item='r'}
                                    <input class="checkbox-inline checkbox" {$r.checked} type="checkbox"
                                           name="parent_id[]" id="parent_{$r.id}" value="{$r.id}"/>
                                    <label  style="margin:10px 20px 10px 3px"  for="parent_{$r.id}">{$r.name}</label>
                                    {/foreach}
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="name" class="col-sm-2 control-label">帐号</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    <input maxlength="20" id="name" name="name" value="{$info.name|default=''}" class="form-control" placeholder="请输入用户帐号">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="password" class="col-sm-2 control-label">密码</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa  fa-eye-slash"></i></span>
                                    <input maxlength="20" type="password" id="password" name="password" class="form-control" placeholder="不修改无需填写">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="nick_name" class="col-sm-2 control-label">姓名或昵称</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-pencil"></i></span>
                                    <input maxlength="20" id="nick_name" name="nick_name" value="{$info.nick_name|default=''}" class="form-control" placeholder="请输入用户姓名或昵称">
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="mobile" class="col-sm-2 control-label">手机号</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-phone"></i></span>
                                    <input type="tel" maxlength="11" id="mobile" name="mobile" value="{$info.mobile|default=''}" class="form-control" placeholder="请输入用户手机号">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="mobile" class="col-sm-2 control-label">邮箱</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <span class="input-group-addon"><i class="fa fa-envelope"></i></span>
                                    <input maxlength="50" type="email" id="email" name="email" value="{$info.email|default=''}" class="form-control" placeholder="请输入用户邮箱">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="avatar" class="col-sm-2 control-label">头像</label>
                            <div class="col-sm-8">
                                <div class="input-group file-caption-main">
                                    <div tabindex="500" class="form-control file-caption  kv-fileinput-caption">
                                        <div class="file-caption-name">
                                            <i class="glyphicon glyphicon-file kv-caption-icon"></i>
                                        </div>
                                    </div>
                                    <div class="input-group-btn">
                                        <div tabindex="500" class="btn btn-primary btn-file"><i class="glyphicon glyphicon-folder-open"></i>&nbsp;  <span class="hidden-xs">浏览</span><input type="file" class="avatar" name="avatar" id="avatar"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        {if isset($info)}
                        <div class="form-group">
                        <label class="col-sm-2 control-label">当前头像</label>
                        <div class="col-sm-8">
                            <div class="input-group file-caption-main">
                                <img src="{$info.avatar}" style="max-width: 150px;max-height: 150px">
                            </div>
                        </div>
                        </div>
                        {/if}
                        <div class="form-group">
                            <label for="status" class="col-sm-2 control-label">是否启用</label>
                            <div class="col-sm-8">
                                <div class="input-group iconpicker-container">
                                    <input {if (isset($info) && $info.status==1) || !isset($info)}checked{/if}
                                           value="{$info.status|default='1'}"
                                           class="switch-is-show" type="checkbox" placeholder="status-switch">
                                    <input id="status" name="status" class="input_status" value="{$info.status|default='1'}" type="hidden" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                {include file="admin_user/form_footer" /}
            </form>
        </div>
    </div>
</div>
